<template>
  <div  class="page-wrapper">
    <div :style="{ width: '100%', height: '5vh',lineHeight: '5vh',display: 'inline-block;' ,background: 'white'}">
<!--      <el-input v-model="docNo"  @keyup.enter.native="getData()" style="width:200px;margin-left: 5px" placeholder="请输入工单号"></el-input>-->
      <el-select v-model="docNo" placeholder="请选择工单号"  filterable clearable style="width:200px;margin-left: 5px">
        <el-option
          @click.native="getData()"
          v-for="item in docNoList"
          :key="item.id"
          :label="item.docNo"
          :value="item.docNo">
        </el-option>
      </el-select>
      <el-button type="primary" @click="getData()"  style="margin-left: 5px;height: 30px">查询</el-button>

    </div>
    <div :style="{ width: '100%',height: '100%',overflowY:'auto',background: 'white',marginTop:'2px'}">
      <measureDR8 :docNo="docNo" ref="dr8"/>
      <div :style="{ width: '100%', height: '1px', background: '#ccc'}"></div>
      <mtPro :docNo="docNo" ref="mtPro"/>
      <div :style="{ width: '100%', height: '1px', background: '#ccc'}"></div>
      <polarity :docNo="docNo" ref="polarity"/>
      <div :style="{ width: '100%', height: '1px', background: '#ccc'}"></div>
      <opltSHHS :docNo="docNo" ref="opltSHHS" style="margin-bottom: 40px"/>
    </div>
  </div>
</template>

<script>
import measureDR8 from '@/views/workorder/measuredr8/index';
import mtPro from '@/views/workorder/interferometermtpro/summary';
import polarity from '@/views/workorder/polarityproduction/index';
import opltSHHS from '@/views/workorder/opltshhs/summary';
import {getDocNoListByType} from "@/api/workorder/workordercps";


export default {
  name: 'DR8-Summary',
  components: {
    measureDR8,
    mtPro,
    polarity,
    opltSHHS
  },
  data() {
    return {
      docNo:null,//工单号用于查询
      docNoList:[]

    };
  },
  created() {
    this.getDocNoDR8ListData();
  },
  mounted() {
    const avueViewDiv = document.getElementById('avue-view');
    if (avueViewDiv) {
      avueViewDiv.style.overflow = 'hidden';
    }
  },

  methods: {
    getDocNoDR8ListData(){
      getDocNoListByType("DR8").then(response => {
        this.docNoList = response.data.data;
      })
    },
    getData() {
      if (this.validatenull(this.docNo)) {
        this.$message.error('请输入工单!');
        return;
      }
      this.$nextTick(() => {
        this.$refs.dr8.searchChange();
        this.$refs.mtPro.searchChange();
        this.$refs.polarity.searchChange();
        this.$refs.opltSHHS.searchChange();
      })
    },


  }
};
</script>
<style scoped>
.page-wrapper {
  width: 100%;
  height: 100%;
}

</style>
